OPTIONAL A.f

ONLY FORTH DEFINITIONS

0 value A@
\ 0 value B@

also assembler
: [a]   &of a@ [u] ;
\ : [b]   &of b@ [u] ;


: a!   s" to A@ " evaluate ; immediate
: +a   s" +to A@ " evaluate ; immediate
: @a+   s" A@ @   CELL +TO A@ " evaluate ; immediate
: h@a+   s" A@ h@   2 +TO A@ " evaluate ; immediate
: w@a+   s" A@ w@   2 +TO A@ " evaluate ; immediate


\ : b!   s" to B@ " evaluate ; immediate
\ : @b+   s" B@ @   CELL +TO B@ " evaluate ; immediate


code !a+
  [a] eax mov
  ebx 0 [eax] mov
  4 # eax add
  eax [a] mov
  pop(ebx)
  ret end-code

: f@a+   a@ f@   8 +to a@ ;


code h!a+
  [a] eax mov
  bx 0 [eax] mov
  2 # eax add
  eax [a] mov
  pop(ebx)
  ret end-code

aka h!a+ w!a+

code c!a+
  [a] eax mov
  bl 0 [eax] mov
  1 # eax add
  eax [a] mov
  pop(ebx)
  ret end-code


: sf!a+  a@ sf!  cell +to a@ ;
: f!a+   a@ f!   8 +to a@ ;


